package com.hlg.xboot.exceptions;


/**
 * <p>服务器异常</p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company: 中视数讯</p>
 * <p>Site: www.digi-zones.com</p>
 *
 * @author yangxin
 * @version 1.0
 * @date 2016/8/5
 */
public class ServerBizException extends RuntimeException {

    private static final long serialVersionUID = -1557974392802481353L;

    protected ErrorCode errCode;

    /**
     * 默认构造函数
     */
    public ServerBizException() {
        super(ErrorCode.SERVER_SYSERR.getRemark());
        this.errCode = ErrorCode.SERVER_SYSERR;
    }

    /**
     * 默认构造函数
     */
    public ServerBizException(String errorMessage) {
        super(errorMessage);
        this.errCode = ErrorCode.SERVER_SYSERR;
    }

    /**
     * @param errCode
     */
    public ServerBizException(ErrorCode errCode) {
        super(errCode.getRemark());
        this.errCode = errCode;
    }

    /**
     * @param message
     * @param errCode
     */
    public ServerBizException(String message, ErrorCode errCode) {
        super(message);
        this.errCode = errCode;
    }

    /**
     * @param cause
     * @param errCode
     */
    public ServerBizException(Throwable cause, ErrorCode errCode) {
        super(cause);
        this.errCode = errCode;
    }

    /**
     * @param message
     * @param cause
     * @param errCode
     */
    public ServerBizException(String message, Throwable cause, ErrorCode errCode) {
        super(message, cause);
        this.errCode = errCode;
    }

    public ErrorCode getErrCode() {
        return errCode;
    }

    public void setErrCode(ErrorCode errCode) {
        this.errCode = errCode;
    }
}
